export function useBrowserInfo() {
  function getBrowserVersion(): number {
    const explorer = window.navigator.userAgent.toLowerCase()
    if (explorer.indexOf('chrome') >= 0) {
      const infos: RegExpMatchArray | null = explorer.match(/chrome\/([\d.]+)/)
      if (infos && infos.length > 0) {
        const ver = infos[1]
        return parseInt(ver)
      }
    }
    return -1
  }
  return {
    getBrowserVersion,
  }
}
